function e(e, t, a) {
    return t in e ? Object.defineProperty(e, t, {
        value: a,
        enumerable: !0,
        configurable: !0,
        writable: !0
    }) : e[t] = a, e;
}

function t(e, t) {
    if (!(e instanceof t)) throw new TypeError("Cannot call a class as a function");
}

Object.defineProperty(exports, "__esModule", {
    value: !0
});

var a = function() {
    function e(e, t) {
        for (var a = 0; a < t.length; a++) {
            var n = t[a];
            n.enumerable = n.enumerable || !1, n.configurable = !0, "value" in n && (n.writable = !0), 
            Object.defineProperty(e, n.key, n);
        }
    }
    return function(t, a, n) {
        return a && e(t.prototype, a), n && e(t, n), t;
    };
}(), n = function() {
    function n(a, r, o) {
        var l;
        t(this, n), this.page = a, this.dataKey = r, this.props = o, a.setData((l = {}, 
        e(l, r + ".promptId", o.promptId), e(l, r + ".title", o.title), e(l, r + ".placeholder", o.placeholder), 
        e(l, r + ".value", o.value), l));
        var i = a.onPromptConfirm || function() {}, u = a.onPromptCancel || function() {};
        a.onPromptConfirm = function(e) {
            i.call(a, e), e.currentTarget.dataset.promptId === a.data[r].promptId && o.onPromptConfirm && o.onPromptConfirm(e);
        }, a.onPromptCancel = function(e) {
            u.call(a, e), e.currentTarget.dataset.promptId === a.data[r].promptId && o.onPromptCancel && o.onPromptCancel(e);
        };
    }
    return a(n, [ {
        key: "show",
        value: function(t) {
            var a = this.page, n = this.dataKey, r = e({}, n + ".shown", !0);
            t && (t.title && (r[n + ".title"] = t.title), t.placeholder && (r[n + ".placeholder"] = t.placeholder), 
            t.value && (r[n + ".value"] = t.value)), a.setData(r);
        }
    }, {
        key: "hide",
        value: function() {
            var t, a = this.page, n = this.dataKey;
            a.setData((t = {}, e(t, n + ".shown", !1), e(t, n + ".value", ""), t));
        }
    } ]), n;
}();

exports.default = n;